<template>
  <el-button :icon="icon"
             @click="click">{{open ? '隐藏':'展开'}}</el-button>
</template>

<script>
export default {
  name: 'ZeroSearch',
  data () {
    return {
      icon: 'el-icon-caret-bottom',
      open: false
    }
  },
  methods: {
    click () {
      this.icon = this.open ? 'el-icon-caret-bottom' : 'el-icon-caret-top'
      this.open = !this.open
      this.$emit('searchOpen', this.open)
    }
  }
}
</script>
